{"ast":null,"code":"import { usePreviousProps } from '@mui/utils';\nexport default function useBadge(parameters) {\n  const {\n    badgeContent: badgeContentProp,\n    invisible: invisibleProp = false,\n    max: maxProp = 99,\n    showZero = false\n  } = parameters;\n  const prevProps = usePreviousProps({\n    badgeContent: badgeContentProp,\n    max: maxProp\n  });\n  let invisible = invisibleProp;\n  if (invisibleProp === false && badgeContentProp === 0 && !showZero) {\n    invisible = true;\n  }\n  const {\n    badgeContent,\n    max = maxProp\n  } = invisible ? prevProps : parameters;\n  const displayValue = badgeContent && Number(badgeContent) > max ? `${max}+` : badgeContent;\n  return {\n    badgeContent,\n    invisible,\n    max,\n    displayValue\n  };\n}","map":{"version":3,"names":["usePreviousProps","useBadge","parameters","badgeContent","badgeContentProp","invisible","invisibleProp","max","maxProp","showZero","prevProps","displayValue","Number"],"sources":["/data/messenger.client/node_modules/@mui/base/BadgeUnstyled/useBadge.js"],"sourcesContent":["import { usePreviousProps } from '@mui/utils';\nexport default function useBadge(parameters) {\n  const {\n    badgeContent: badgeContentProp,\n    invisible: invisibleProp = false,\n    max: maxProp = 99,\n    showZero = false\n  } = parameters;\n  const prevProps = usePreviousProps({\n    badgeContent: badgeContentProp,\n    max: maxProp\n  });\n  let invisible = invisibleProp;\n  if (invisibleProp === false && badgeContentProp === 0 && !showZero) {\n    invisible = true;\n  }\n  const {\n    badgeContent,\n    max = maxProp\n  } = invisible ? prevProps : parameters;\n  const displayValue = badgeContent && Number(badgeContent) > max ? `${max}+` : badgeContent;\n  return {\n    badgeContent,\n    invisible,\n    max,\n    displayValue\n  };\n}"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,YAAY;AAC7C,eAAe,SAASC,QAAQ,CAACC,UAAU,EAAE;EAC3C,MAAM;IACJC,YAAY,EAAEC,gBAAgB;IAC9BC,SAAS,EAAEC,aAAa,GAAG,KAAK;IAChCC,GAAG,EAAEC,OAAO,GAAG,EAAE;IACjBC,QAAQ,GAAG;EACb,CAAC,GAAGP,UAAU;EACd,MAAMQ,SAAS,GAAGV,gBAAgB,CAAC;IACjCG,YAAY,EAAEC,gBAAgB;IAC9BG,GAAG,EAAEC;EACP,CAAC,CAAC;EACF,IAAIH,SAAS,GAAGC,aAAa;EAC7B,IAAIA,aAAa,KAAK,KAAK,IAAIF,gBAAgB,KAAK,CAAC,IAAI,CAACK,QAAQ,EAAE;IAClEJ,SAAS,GAAG,IAAI;EAClB;EACA,MAAM;IACJF,YAAY;IACZI,GAAG,GAAGC;EACR,CAAC,GAAGH,SAAS,GAAGK,SAAS,GAAGR,UAAU;EACtC,MAAMS,YAAY,GAAGR,YAAY,IAAIS,MAAM,CAACT,YAAY,CAAC,GAAGI,GAAG,GAAI,GAAEA,GAAI,GAAE,GAAGJ,YAAY;EAC1F,OAAO;IACLA,YAAY;IACZE,SAAS;IACTE,GAAG;IACHI;EACF,CAAC;AACH"},"metadata":{},"sourceType":"module"}